package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 *使用转换流读取
 */
public class ISRDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream file=new FileInputStream("osw.txt");
        InputStreamReader rea=new InputStreamReader(file, StandardCharsets.UTF_8);
       // BufferedReader buffer=new BufferedReader(rea);
        /*
        int read()
        读取一个字符(到底读取几个字节要根据它的内容以及字符集来决定的)
         */
        int d;
        while ((d= rea.read())!=-1){
            System.out.print((char) d);
        }

        rea.close();
    }
}
